package com.lhy.skywalking.user.controller;

import com.lhy.skywalking.common.domain.AjaxResult;
import com.lhy.skywalking.user.dto.UserDTO;
import com.lhy.skywalking.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/users")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/{id}")
    public AjaxResult getById(@PathVariable long id) {
        return AjaxResult.success(userService.getUserById(id));
    }
}
